//Ext setting
Ext.Loader.setConfig({enabled:true});


Ext.application({
    name:'AM',
    appFolder:'app',
    launch:function () {
        window.ppt = window.ppt || Ext.create("AM.PPT");
        var layout = Ext.create('AM.view.Layout');
        layout.doLayout();

        var body = Ext.getBody();
        body.addKeyListener(Ext.EventObject.F2, AM.service.Start.new_2Row);
        body.addKeyListener(Ext.EventObject.F10, function(){
            AM.service.PlayCSS.begin(0)});

        Ext.getBody().addKeyListener([Ext.EventObject.LEFT, Ext.EventObject.UP],
            function () {
                if (document.webkitIsFullScreen) {
                    AM.service.PlayCSS.prev();
                }
                else {
                    AM.service.WorkSpace.prev();
                }
            }
        )
        Ext.getBody().addKeyListener([Ext.EventObject.RIGHT, Ext.EventObject.DOWN],
            function () {
                if (fullScreenApi.isFullScreen()) {
                    AM.service.PlayCSS.next();
                }
                else {
                    AM.service.WorkSpace.next();
                }
            }
        )
    }
});
